Feature: Bull Mesh Offline Transaction Relay - #1787
Conversation
|
Hey guys, I'm attending your talk at the Medellín Bitcoin conference. Great stuff, thanks and keep building! |
|
Hello @atomauro and thanks for your interest in improving BULL wallet I have remarks/questions:
|
|
Awesome effort! This sounds very interesting!! Thank you! You will have to give us some time to review and test this since its not part of our scope and we are in the middle of 2 huge releases back to back till March. How did you test this? Will be great if you give us some screenshares or videos so we get an idea. |
|
This PR seems stale with no answers from the maintainer in two months. If we do implement a mesh networks, we will likely follow an existing standardized protocol like FIPS. I'm closing this PR, but author can re-open it, if wants to follow up |
Fix the money Fix the world
Overview
This Pull Request integrates Bull Mesh, a resilient offline communication layer allowing signed Bitcoin transactions to be broadcast without an Internet connection. The system leverages Bluetooth Low Energy (BLE) to propagate transactions to nearby peers (Relays), who then forward them to the Bitcoin Mempool.
Technical Architecture
The implementation utilizes a three-tier architecture designed to overcome standard BLE data limitations and OS-level background execution constraints.
1. Fragmentation Protocol (
MeshProtocol)To bypass the standard BLE MTU limit (~23-512 bytes), a custom application-layer fragmentation protocol has been implemented in
lib/core/mesh/mesh_protocol.dart.[TotalChunks (1B) | ChunkIndex (1B)].Map<int, Uint8List>to accumulate chunks out-of-order, reassembling the full payload only whenmap.length == totalChunks.2. Persistent Background Services (
MeshBackgroundService)To ensure high availability of Relays, the system implements OS-specific background persistence strategies.
flutter_background_serviceto spawn a dedicated Isolate.bluetooth-central,bluetooth-peripheral, andfetchcapabilities inInfo.plist.injectIncomingTxandinjectDownloadProgressinMeshServicehandle the safe ingestion of background events.3. Transmission Strategy: "Looping Beacon"
The Sender implements a cyclic transmission strategy to maximize connection probability without strict handshakes:
1->2->3...1->2->3).User Interface Implementation
Sender: Adaptive Radar (
MeshSignalAnimation)uploadProgressNotifier.Receiver: Reactive Dashboard (
MeshRelayDashboard)downloadProgressNotifier(start of transmission) orincomingTransactionsstream (completion).Security & Validation
^[0-9a-fA-F]+$) before any interaction with the BDK (Bitcoin Dev Kit).Verification
Unit Testing
test/core/mesh/mesh_protocol_test.dart:Uint8Listpayloads.Manual Verification
File Manifest
lib/core/mesh/mesh_protocol.dartlib/core/mesh/mesh_service.dart,lib/core/mesh/mesh_background_service.dartlib/features/broadcast_signed_tx/presentation/widgets/android/app/src/main/AndroidManifest.xml,pubspec.yaml